import Vue from 'vue'
import VueRouter from 'vue-router'
import Layout from '@/layout'
import Index from '../views/index.vue'

Vue.use(VueRouter)

const routes = [

  {
    path: "/",
    name: 'Layout',
    component: Layout,
    children: [
      {
        path: '/',
        name: 'index',
        component: Index
      } 
    ]
  }



]

const router = new VueRouter({
  mode: 'history',
  base: process.env.BASE_URL,
  routes
})

// 导航守卫
router.beforeEach((to, from, next) => {
  next()
})

export default router
